﻿<catel:UserControl x:Class="Catel.Examples.WPF.Prism.Modules.Departments.Views.DepartmentsView"
                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                   xmlns:catel="http://catel.codeplex.com"
                   xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity">

    <!--  Resources  -->
    <catel:UserControl.Resources />

    <!--  Content  -->
    <catel:StackGrid>
        <catel:StackGrid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </catel:StackGrid.RowDefinitions>

        <TextBlock HorizontalAlignment="Left"
                   VerticalAlignment="Top"
                   FontWeight="Bold"
                   Text="List of departments" />

        <ListBox ItemContainerStyle="{StaticResource ExampleListboxItemStyle}"
                 ItemsSource="{Binding Departments}"
                 SelectedItem="{Binding SelectedDepartment,
                                        Mode=TwoWay}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="SelectionChanged">
                    <catel:EventToCommand Command="{Binding Select}" DisableAssociatedObjectOnCannotExecute="False" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid>
                        <Border BorderThickness="1" CornerRadius="1">
                            <TextBlock Text="{Binding Name}" />
                        </Border>
                    </Grid>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <CheckBox x:Name="displayNotificationsCheckBox" IsChecked="{Binding IsNotificationVisible, Mode=TwoWay}" >
            Display Notifications
        </CheckBox>
    </catel:StackGrid>
</catel:UserControl>
